<?php

class publicbase extends CI_Controller {

    //-- init base variable

    public function __construct() {
        //-- load basic controller
        parent::__construct();
        //-- load app data
        $this->baseLoadApp();
        //-- view app data
        $this->baseViewApp();
    }
    /*
     * Method pengolah base load
     * diperbolehkan untuk dioverride pada class anaknya
     */

    protected function baseLoadApp() {
        //-- load themes (themes default : default)
        $this->smarty->load_themes();
        //-- load base models
        //-- load javascript
        $this->smarty->load_javascript("resource/js/jquery.dropdown/dropdown.js");

        //-- load style
    }

    /*
     * Method pengolah base view
     * diperbolehkan untuk dioverride pada class anaknya
     */

    protected function baseViewApp() {
        $this->smarty->assign("arrConfig", $this->config);
        //-- display global link
        self::displayBaseLink();
        //-- display site title
        self::displaySiteTitle();
        //-- display top navigation
        self::displayTopNavigation();
    }

    /*
     * Method layouting base document
     * diperbolehkan untuk dioverride pada class anaknya
     */
    protected function display($pStrTemplateName = 'base/public/header.html') {
       
        //-- assign template
        $this->smarty->assign("strTemplateContent", "base/public/document.html");
        //-- set template
        $this->smarty->display($pStrTemplateName);
    }
    

    //-- display base link
    private function displayBaseLink() {
        //-- set url
        $this->smarty->assign("strUrlProcessLogin", site_url("login/loginmember/loginProcess"));
        $this->smarty->assign("strUrlMember", site_url("home/welcomemember/index"));
        $this->smarty->assign("strUrlLogout", site_url("login/loginmember/logoutProcess"));
    }

    //-- set site title
    private function displaySiteTitle() {

        $this->smarty->assign("strPageTitle", "CiSmart | Time Excelindo PHP Framework");
    }

    //-- top navigation
    private function displayTopNavigation() {
        //-- get parent selected
    }
}